package cn.xyafu.controller;

import cn.xyafu.po.Type;
import cn.xyafu.service.TypeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.servlet.http.HttpSession;
import java.util.List;

@Controller
public class TypeController {
    @Autowired
    private TypeService typeService;

    /**
     * 查找所有类型
     */
    @RequestMapping("/allType")
    public String allType(HttpSession session, Model model){
        List<Type> types = this.typeService.findAllType();
        session.setAttribute("TYPES_SESSION",types);
//        model.addAttribute("TYPES_SESSION",types);
        return "forward:allLost";
    }
}
